<template>
    <div>
        <course-detail :html="htmlSrc" :title="title" :banner="banner" :part="partName"></course-detail>
    </div>
</template>

<script>
    import { getlessonDetailByVisitor } from '@/api'
    import CourseDetail from '@/modules/common/CourseDetail.vue'
    export default {
        components:{
            CourseDetail
        },
        props: ['holderId'],
        data(){
            return {
                title: '',
                htmlSrc: '',
                banner: '',
                id: this.$route.params.id,
                partName: ''
            }
        },
        created(){
            console.log(this.holderId)
            getlessonDetailByVisitor({lessonId: this.id, holderId: this.holderId}).then( res => {
                const {name, coverUrl, content, partName} = res.data.result
                this.title = name
                this.partName = partName
                this.banner = coverUrl
                this.htmlSrc = content
            })
        }
    }
</script>

<style scoped>

</style>